﻿using System.Collections.Generic;
using Newtonsoft.Json;

namespace OneWorks.Utils.Easyui.DataGrid
{
    public class Entity<T> 
    {
        [JsonProperty(PropertyName = "total")]
        public int Total { get; set; }

        [JsonProperty(PropertyName = "rows")]
        public T Rows { get; set; }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this, Formatting.None, new JsonSerializerSettings
                                                                         {
                                                                             DateFormatString = "yyyy-MM-dd HH:mm:ss"
                                                                         });
        }
    }
}
